<template>
  <div class="bigest">
    <div class="contain">
      <router-view :class="{routerop:isrouterop}" v-bind:message="parentselect" v-on:listenToChildEventshow="showaside" v-on:listenToChildEventhiden="hidenaside"></router-view>
    </div>
    <div :class="{aside:addaside,asideselected:asideselect}">
      <div class="asidefirstitem" @click="hidenaside">
        <span><img class="seximgsize" src="./static/img/aside/girl@2x.png" alt=""></span>
        <span>物有所享</span><br>
        <span style=" font-size:14px;"><router-link to="/test">130****9034</router-link></span>
      </div>
      <div class="asideitem" @click="hidenaside">
        <span><router-link to="/myorder"><img class="itemimgsize" src="./static/img/aside/order@2x.png" alt=""></router-link></span>
      </div>
      <div class="asideitem" @click="hidenaside">
        <span><img class="itemimgsize" src="./static/img/aside/wallet@2x.png" alt=""></span>
      </div>
      <div class="asideitem" @click="hidenaside">
        <span><router-link to="/authentication"><img class="itemimgsize" src="./static/img/aside/certification@2x.png" alt=""></router-link></span>
      </div>
      <div class="asideitem" @click="hidenaside">
        <span><router-link to="/person"><img class="itemimgsize" src="./static/img/aside/set@2x.png" alt=""></router-link></span>
      </div>
      <div class="asideitem" @click="hidenaside">
        <span><img class="itemimgsize" src="./static/img/aside/customer@2x.png" alt=""></span>
      </div>
    </div>
    <div :class="{asideright:asideright_s,asideselected:asideselect}"  @click="hidenaside"></div>

  </div>
</template>

<script>
import sent from './components/sentCenter/sent.vue'
export default{
  data(){
    return {
      isrouterop:false,
      parentselect:"hello",
      asideselect:false,
      addaside:true,
      asideright_s:true,
    }
  },
  
  methods:{
    showaside:function(data){
      this.asideselect = true;
      this.isrouterop = true;
    },
    hidenaside:function(data){
      this.asideselect = false;
      this.isrouterop = false; 
    }
  },
  components:{
    sent
  }
}
</script>

<style>
.bigest{
  display: flex;
  justify-content: center;
}
.contain{
  display: flex;
  max-width: 30rem;
  justify-content: center;
   z-index:1;
}
.routerop{
  opacity: 0.2;
}
.aside{
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 10rem;
  color: gray;
  background-color: #fff;
  z-index:0;
  height: 50rem;
  margin-left: -7rem;
  opacity: 0;
}
.asideright{
  position: absolute;
  width: 13.5rem;
  z-index:0;
  height: 50rem;
  margin-left: 4.5rem;
  opacity: 0;
}
.seximgsize{
  width: 15px;
  height: 15px;
}
.asidefirstitem{
  padding-top: 2rem;
  padding-bottom:2.5rem
}
.asideitem{
  padding-top: 1rem;
  padding-bottom: 1rem;
}
.itemimgsize{
  height: 18px;
  width: 100px;
}
.asideselected{
  z-index: 3;
  opacity: 1;
}
</style>

